/**
 * Copyright(c) Hainan eKing Technology co., LTD
 *
 * @date 2013年8月14日
 * 	
 * Original Author: 郑兴(zhengxing)
 *
 * ChangeLog
 *
 */
package com.hnas.sys.service.system.dto;

import java.io.Serializable;
import java.util.List;

import com.hnas.sys.domain.PackageStatus;
import com.hnas.sys.domain.ResourceStatus;

/**
 * @author 郑兴(zhengxing)
 *
 */
public class DTOMenuPackage implements Serializable,Comparable<DTOMenuPackage> {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3898819523725012276L;
	
	private long id;
	private String name;
	private String description;
	private int priority;
//	private String statusStr;//显示/隐藏
	private PackageStatus status;
//	private List<DTOResource> resources;
	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the priority
	 */
	public int getPriority() {
		return priority;
	}
	/**
	 * @param priority the priority to set
	 */
	public void setPriority(int priority) {
		this.priority = priority;
	}
	/**
	 * @return the status
	 */
	public PackageStatus getStatus() {
		return status;
	}
	/**
	 * @param status the status to set
	 */
	public void setStatus(PackageStatus status) {
		this.status = status;
	}
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(DTOMenuPackage o) {
		if(null != o) {
			if(this.priority < o.priority) {
				return -1;
			} else if(this.priority > o.priority) {
				return 1;
			} else {
				if(this.id < o.id) {
					return -1;
				} else if(this.id > o.id) {
					return 1;
				} else {
					return 1;
				}
			}
		}
		return 0;
	}
//	public List<DTOResource> getResources() {
//		return resources;
//	}
//	public void setResources(List<DTOResource> resources) {
//		this.resources = resources;
//	}
//	public String getStatusStr() {
//		return statusStr;
//	}
//	public void setStatusStr(String statusStr) {
//		this.statusStr = statusStr;
//	}
	public void setId(long id) {
		this.id = id;
	}
	public boolean isValid(){
		return PackageStatus.SHOW.equals(this.status);
	}
}
